import { useStore } from 'vuex'
import { computed } from "vue";

export default function userInfo() {
  let store = useStore();
  function add(userInfo) {
    store.commit("add", userInfo);
  }
  function listx(list) {
    store.commit("listx", list)
  }
  return {
    user: computed(() => {
      return store.state.user;
    }),
    list: computed(() => {
      return store.state.list;
    }),
    h: store.state.h,
    head: store.state.head,
    add,
    listx
  };
}
